﻿namespace IdGen;

/// <summary>
/// 保存有关已解码标识符的信息
/// </summary>
public record struct Id
{
    /// <summary>
    /// 获取该标识符的序列号
    /// </summary>
    public int SequenceNumber { get; private set; }

    /// <summary>
    /// 获取生成该标识符的生成器的生成器标识
    /// </summary>
    public int GeneratorId { get; private set; }

    /// <summary>
    /// 获取该标识符生成时的日期 / 时间
    /// </summary>
    public DateTimeOffset DateTimeOffset { get; private set; }

    internal Id(int sequenceNumber, int generatorId, DateTimeOffset dateTimeOffset)
    {
        SequenceNumber = sequenceNumber;
        GeneratorId = generatorId;
        DateTimeOffset = dateTimeOffset;
    }
}